﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Devfw.OpenAuth.Platform;
using System.Configuration;

namespace WebSite.ThirdPartyLogin
{
    public partial class TencentAuth : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string apiKey = ConfigurationManager.AppSettings["TencentApiKey"]; //"57ba1f3e778f46dfa975d9f9563f9070";
            string apiSecret = ConfigurationManager.AppSettings["TencentApiSecret"]; //"a15df444fed534c8907a13107b524557";
            string callbackUrl = ConfigurationManager.AppSettings["TencentCallbackUrl"];// http://127.0.0.1:8001/tencentcallback.aspx

            TencentV2 tencent = new TencentV2(apiKey, apiSecret);
            string authUrl = tencent.GetAuthorizeUrl(callbackUrl);
            // Response.Write(authUrl);
            Response.Redirect(authUrl);
            
        }
    }
}